<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta charset="utf-8">
<title>角色表</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
 <link rel="stylesheet" href="../../res/css/layui.css"  media="all">
<script type="text/javascript" src="../../res/js/jquery-1.11.2.min.js"></script>
<script src="../../res/js/cx/layui-xtree/layui-xtree.js"></script>
</head>
  <style type="text/css">
        .downpanel .layui-select-title span {
            line-height: 38px;
        }
 
        /*继承父类颜色*/
        .downpanel dl dd:hover {
            background-color: inherit;
        }
    </style>
    <style type="text/css">
    	#buttn{
    		margin-bottom: 30px;
    	}
	    .aru{
	 		width:65%;
	 		margin: 0 auto;
	 		margin-left:80px;
	 		margin-top: 15px;
	 	}
     	.xtree_contianer {
            width: 400px;
            overflow: auto;
            margin-left:110px;
            background-color: #fff;
            padding: 10px 0 25px 5px;
        }
        body {
            height: 100%;
            width: 100%;
            background-size: cover;
            margin: 0 auto;
        }
        td {
            font-size: 12px !important;
        }
 
        .layui-form-checkbox span {
       		width:180px;
            height: 30px;
        }
        .layui-field-title {
            border-top: 1px solid white;
        }
        table {
            width: 100% !important;
        }
    </style>
<body>

 <div class="demoTable" style="margin-left:20px;margin-top: 10px;">
	 搜索角色名称:
	<div class="layui-inline">
		<input class="layui-input" style="height: 32px;" id="roleName" placeholder="根据角色名称查询" autocomplete="off">
	</div>
  <button class="layui-btn layui-btn-sm" data-type="reload" id="selectButton">搜索</button>
  <button class="layui-btn layui-btn-warm layui-btn-sm" id="insert">增加</button>
</div>
 
<table class="layui-hide" id="LAY_table_user" lay-filter="user"></table> 
<table class="layui-table" lay-data="{ url:'../../role/queryAll.action', page:true, id:'idTest'}" lay-filter="demo">
  <thead>
    <tr>
      <th lay-data="{type:'checkbox', fixed: 'left'}"></th>
      <th lay-data="{field:'roName',align:'center'}">角色名称</th>
      <th lay-data="{field:'isva', align:'center',templet:'#isvaTpl'}">是否有效</th>
      <th lay-data="{field:'roExplain', align:'center'}">角色说明</th>
      <th lay-data="{field:'optime', align:'center'}">操作时间</th>
      <th lay-data="{field:'oper', align:'center'}">操作人</th>
      <th lay-data="{fixed: 'right', align:'center', toolbar: '#barDemo'}">操作</th>
    </tr>
  </thead>
</table>

<script type="text/javascript" id="isvaTpl">
	 {{# if(d.isva == 0) { }}
     <div>否</div>
 	 {{# } else if(d.isva == 1){ }}
    <div>是</div>
	 {{# }}}

</script>
<script type="text/html" id="barDemo">
  <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>

<!-- 增加或修改的弹框 -->
	<div id="addOrUpdate" style="display: none;">
		<form id="myform" class="layui-form" method="post"
			action="<%=basePath %>SiteServlet?action=submit"
			style="margin-top: 10px;">
			
			<input type="hidden" name="roId" id="roId" />
			
			<div class="aru">
				<label class="layui-form-label">角色名称:</label>
				<div class="layui-input-block">
					<input name="roName" id="roName" onblur="findRoName()" class="layui-input" type="text" placeholder="角色名称">
					<input type="hidden"  class="fromYz" id="roNameYz">
				</div>
			</div>
			

			<div class="aru">
				<label class="layui-form-label">是否有效:</label>
			    <div class="layui-input-block">
			      <select name="isva" id="isva" lay-filter="aihao">
			        <option value=""></option>
			        <option value="1">是</option>
			        <option value="0">否</option>
			      </select>
			    </div>
			</div>
			
			<div class="aru">
				<label class="layui-form-label">角色模块:</label>
				<div id="xtree3" class="xtree_contianer"></div>
			</div>
			
			<div class="aru">
				<label class="layui-form-label">角色描述:</label>
			    <div class="layui-input-block">
			      <textarea name="roExplain" id="roExplain" placeholder="请输入内容" onblur="findRoExplain()" class="layui-textarea"></textarea>
			       <input type="hidden"  class="fromYz" id="roExplainYz">
			    </div>
			</div>
			
			<div class="aru" id="buttn">
				<div class="layui-input-block">
					<input type="button" class="layui-btn" id="sub" value="确认提交" /> 
					<a href="javascript:exit();" class="layui-btn layui-btn-danger">关闭</a>
				</div>
			</div>
		</form>
	</div>
<script src="../../res/layui.all.js" charset="utf-8"></script>
<script type="text/javascript" src="../../res/js/cx/snRole.js"></script>
</body>
</html>